#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"
TestSList1()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTDestroy(&plist);
}
TestSList2()
{
	SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTPopBack(&plist);
	SLTPrint(plist);
	SLTNode* ret = SLTFind(plist, 2);
	ret->data *= 2;
	SLTPrint(plist);
	SLTDestroy(&plist);
}

TestSList3()
{
	SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPrint(plist);
	SLTDestroy(&plist);
}
TestSList4()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTNode* ret = SLTFind(plist, 2);
	SLTInsert(&plist, ret, 20);
	SLTPrint(plist);
	SLTNode* rel = SLTFind(plist, 3);
	SLTErase(&plist, rel);
	SLTPrint(plist);
	SLTDestroy(&plist);
}

TestSList5()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTNode* rel = SLTFind(plist, 3);
	SLTIsertAfter(rel,50);
	SLTPrint(plist);
	SLTNode* ret = SLTFind(plist, 1);
	SLTEraseAfter(ret);
	SLTPrint(plist);
	SLTDestroy(&plist);
}

int main()
{
	TestSList1();
	TestSList2();
	TestSList3();
	TestSList4();
	TestSList5();
	return 0;
}